package Test;

public class ArraySort {
    private int[] sim;

    public ArraySort(int[] sim){
        this.sim=sim;
    }

    /**
     * 对成员变量sim进行排序
     * 顺序：从小到大
     * 方式：冒泡排序
     */
    public void setOrder(){
        for (int i = 0; i < sim.length; i++) {
            for (int j = i+1; j <sim.length ; j++) {
                if (sim[i]>=sim[j]){
                    int temp=sim[i];
                    sim[i]=sim[j];
                    sim[j]=temp;
                }
            }
        }
    }

    public int[] getSim() {
        return sim;
    }
}
